Ext.define('PJ.view.codtrainingprogram.AuditOpinionEdit', {
	extend: 'AM.default.DefaultWindowForm',
	alias: ['widget.auditOpinionEdit'],
	requires: ['AM.default.jsonp.DefaultSubmitJsonp',
	           'AM.default.DefaultDateField'],

	modal: true,// 开启不允许点击其他组件
	frame: true,
	notEdit: true,
	width: 350,
	height:185,
	layout: 'form',
	isSame: false,
	autoHeight: true,

	initComponent: function(){
    	var me = this;
    	var bt = '<span style="color:red;">*</span>';
    	me.items= [{
    		border: false,
    		xtype: "container",
    		width: 320,
    		layout: 'column',
    		items: [{
    			xtype: 'textareafield',
    			fieldLabel: me.isView ? "审核意见" : bt + '审核意见',
    			labelAlign: 'right',
    			labelWidth: 60,
    			maxLength: 200,
    			name: 'rejectReason',
    			allowBlank: me.isView ? true:false,
    			readOnly:me.isView,
    			height: 100,
    			columnWidth: 1
    		}]
    	}];
    	this.buttons = [{
            text: '确定',
            hidden: me.isView,
            handler: function(button, event){
                var win = button.up('window');
                win.sub();
            }
        }, {
            text: '关闭',
            scope: this,
            handler: function(button, event){
                var win = button.up('window');
                win.close();
            }
        }];
		this.callParent(arguments);
	},
    sub:function(){
		var win = this;
		var form = win.down('form');
		var baseForm = form.getForm();
		if (!baseForm.isValid()) {
			return;
		}
		win.win.rejectReason = baseForm.findField("rejectReason").getValue();
		win.win.sub("back");
		win.close();
    }
});